pkgname=rivercarro
pkgver=0.5.0
pkgrel=0
pkgdesc="A layout generator for river Wayland compositor, fork of rivertile"
url="https://git.sr.ht/~novakane/rivercarro"
arch="x86_64 aarch64" # limited by zig aport
license="GPL-3.0-only"
maintainer="Maarten van Gompel <proycon@anaproy.nl>"
makedepends="
	libevdev-dev
	libxkbcommon-dev
	pixman-dev
	scdoc
	wayland-dev
	wayland-protocols
	wlroots-dev
	zig
	"
options="!check net"
subpackages="
	$pkgname-doc
"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~novakane/rivercarro/refs/download/v$pkgver/rivercarro-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

# We may want other than "baseline" for other targets, when enabled by zig
case "$CARCH" in
	aarch64|x86_64) _cputarget=baseline ;;
esac

build() {
	# This installs it to $builddir/out
	DESTDIR="$builddir/out" zig build \
		-Doptimize=ReleaseSafe \
		--prefix /usr install \
		${_cputarget:+-Dcpu="$_cputarget"}
}

package() {
	mkdir -p "$pkgdir"
	cp -r out/* "$pkgdir"
	install -Dm644 "doc/$pkgname.1" -t "$pkgdir/usr/share/man/man1"
}


sha512sums="
2dbbdb93cdd06c727072c1e2e9e0e5a7c1b0dadf7d29dd95805e22920b776107115fc9ea9831113412eb507fd51c06115f8124388d0a5644398ed4ce208548c2  rivercarro-0.5.0.tar.gz
"
